package com.bili.bili_data_api.service.impl;

import com.bili.bili_data_api.dao.mapper.Num2Mapper;
import com.bili.bili_data_api.dao.pojo.Num2;
import com.bili.bili_data_api.service.PartScoreCompareService;
import com.bili.bili_data_api.vo.Num2Vo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class PartScoreCompareServiceImpl implements PartScoreCompareService {

    @Autowired
    private Num2Mapper num2Mapper;

    @Override
    public Num2Vo getAll() {
        List<Num2> num2s = num2Mapper.selectList(null);
        List<String> type=new ArrayList<>();
        List<String> min=new ArrayList<>();
        List<String> mid=new ArrayList<>();
        List<String> max=new ArrayList<>();
        Num2Vo num2Vo = new Num2Vo();
        for (Num2 num2 : num2s) {
            type.add(num2.getType());
            min.add(num2.getMin());
            mid.add(num2.getMid());
            max.add(num2.getMax());
        }
        num2Vo.setType(type);
        num2Vo.setMin(min);
        num2Vo.setMid(mid);
        num2Vo.setMax(max);
        return num2Vo;
    }
}
